﻿@page "/auditlogs"
@attribute [Authorize]

<div class="card">
    <div class="card-header">
        Audit Logs
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <div style="float: right">
            <Pagination TotalItems="TotalItems" PageSize="PageSize" CurrentPage="CurrentPage" PageChanged="GetAuditLogsAsync"></Pagination>
            </div>
            <table class="table">
                <thead>
                    <tr>
                        <th>Date Time</th>
                        <th>User Name</th>
                        <th>Action</th>
                        <th>Data</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var auditLog in AuditLogs)
                    {
                        <tr>
                            <td>
                                @auditLog.CreatedDateTime
                            </td>
                            <td>@auditLog.UserName</td>
                            <td>@auditLog.Action</td>
                            <td>@auditLog.Log</td>
                        </tr>
                    }
                </tbody>
            </table>
            <div style="float: right">
            <Pagination TotalItems="TotalItems" PageSize="PageSize" CurrentPage="CurrentPage" PageChanged="GetAuditLogsAsync"></Pagination>
            </div>
        </div>
    </div>
</div>
